/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package formulagraph;

import formulagraph.lineas.Linea;

/**
 *
 * @author soler4888
 */
public class EntradaLeyenda {
    private Texto texto;
    private Segmento linea;

    public EntradaLeyenda(double x, double y, String texto, Linea linea) {
        this.texto = new Texto(texto, x + 65, y + 4);
        this.linea = new Segmento(new Punto(x, y), new Punto(x + 55, y), linea);
    }

    public Segmento getLinea() {
        return linea;
    }
    
    public String dibujar() {
        StringBuilder builder = new StringBuilder();
        
        builder.append(linea.dibujar()).append("\n");
        builder.append(texto.dibujar()).append("\n");
        
        return builder.toString();
    }
}
